<?php 
require('./conn.php');
$id = $_GET['id'];
if(empty($_POST)){
	$sql = "select * from msg where id = $id ";
	$rs = mysql_query($sql);
	$row = mysql_fetch_assoc($rs);
	//print_r($row);
	require('./megedit.html');
}else{
	$sql = "update msg set name = '$_POST[name]', email = '$_POST[email]', content = '$_POST[content]' where id = $id ";
	if(!mysql_query($sql)){
		echo mysql_error();
	}else{
		echo '修改成功';
	}
}